package com.pgcomb.poweriot.alarmservice.alarm;


import com.pgcomb.common.enums.AlarmType;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zhengheqi
 * @version 1.0
 * @description: 告警信息 的生产工厂
 * @date 2021/5/29 15:10
 */
public class AlarmMessageFactory {
    private static Map<String, AlarmMessage> alarmMap = new HashMap<>();

    public static void register(AlarmType alarmType, AlarmMessage alarm){
        alarmMap.put(alarmType.getType(), alarm);
    }

    public static AlarmMessage getAlarm(String type){
        return alarmMap.get(type);
    }
}
